5 tbsp. salted butter, plus more for the baking dish
1 10-ounce package cremini mushrooms, thickly sliced
5 medium onions, thinly sliced
1 tbsp. fresh thyme, chopped
1/2 tsp. kosher salt
Black pepper, to taste
2 tbsp. all-purpose flour
1/2 c. dry white wine
3 c. low-sodium beef broth
2 c. chopped rotisserie chicken (skin removed)
1 long baguette, sliced 1/2 inch thick
2 1/2 c. shredded gruyère cheese (about 10 ounces)
1/2 c. grated parmesan cheese
Preheat the oven to 425 ̊. Butter a 9-by-13-inch or other 3-quart baking dish. Melt 1 tablespoon butter in a large pot over medium-high heat. Add the mushrooms and cook, without stirring, until browned on the bottom, about 2 minutes. Stir and continue to cook until browned all over, 2 to 3 minutes more. Remove the mushrooms to a plate.
Add the remaining 4 tablespoons butter to the pot and melt over medium-low heat. Add the onions and cook, stirring frequently, until dark golden, 20 to 25 minutes.
Return the mushrooms to the pot. Add the thyme, salt and a few grinds of pepper. Sprinkle in the flour and stir to coat the vegetables. Let toast for a minute, then increase the heat and pour in the wine. Bring to a simmer, then add the broth and chicken. Return to a simmer and cook, stirring, until thickened, about 3 minutes.
Ladle enough of the onion-chicken mixture into the baking dish to cover the bottom. Arrange half of the baguette slices in a single layer on top. Ladle half of the remaining onion-chicken mixture on top and push down on the baguette slices with the bottom of the ladle to submerge. Sprinkle with 1 cup gruyère and 1/4 cup parmesan. Top with the remaining baguette slices in a single layer. Ladle the remaining onion-chicken mixture on top. Sprinkle with the remaining 1 1/2 cups gruyère and 1/4 cup parmesan.
Cover the casserole with foil, tenting it so it doesn’t touch the cheese. Place on a rimmed baking sheet and bake until bubbly, about 20 minutes. Uncover and bake until the top is browned and crusty, about 15 minutes more. Let sit for 10 minutes before serving.